package collect;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Demo3 {
    public static void main(String[] args) {
        /*Set<Person> cld=new ArrayList<>();
        Person s1=new Person("tom",23);
        Person s2=new Person("jerry",23);
        Person s3=new Person("alice",23);
        Person s4=new Person("Ada",23);
        cld.add(s2);cld.add(s3);
        root.setChildren(cld);
        List<Person> sun=new ArrayList<>();
        sun.add(s4);
        s2.setChildren(sun);
        out(root);
        }
public static void out(Person root){
        if (root == null) return;
        System.out.println(root);
        if (root.setChildren() !=null){
            out(p);
        }

    }
}*/
        class Person {
            private String name;
            private Integer age;
            private List<Person> Children;

            public Person() {
            }

            public Person(String name, Integer age) {
                this.name = name;
                this.age = age;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public Integer getAge() {
                return age;
            }

            public void setAge(Integer age) {
                this.age = age;
            }

            @Override
            public String toString() {
                return "学生{" +
                        "姓名='" + name + '\'' +
                        ", 年龄=" + age +
                        '}';
            }

        }
    }
}
